 
<header id="header" class="mui-bar mui-bar-black mui-bar-nav">
    <a class="mui-icon mui-icon-left-nav mui-pull-left" href="{:url('site/site_list')}"></a>
    <h1 class="mui-title">{$result.building_name}</h1>
</header>
 {include file="site/site_nav" /}
<div class="mui-content mui-content-my schedule-msg" style="padding-top: 0;margin-top: 1em">
    <div class="schedule-msg-left">
        <div class="line"></div>
        <div class="zhe"></div>
    </div>
    <div class="schedule-msg-right">
        <ul>
            <li>
                <h2 id="scheduleStart">工地立项 <i class="dian"></i></h2>
                <p><span class="spanWidth"><?php echo date("Y-m-d",$result['building_create_time'])?></span> 负责人{$result.building_add_user_name}</p>
            </li>
            <li>
                <h2>建设中 <i class="dian"></i></h2>
                <ul id="schList">

                    {volist name="list" id="vv"} 
                    <?php if($vv['progress_type'] ==1 ) {?>
                    <li class="mui-table-view-cell collapse">
                        <a class="mui-navigate-right" href="javascript:void(0);"><span class="spanWidth"><?php echo date("Y-m-d",$vv['progress_add_time'])?></span> 工种名称:工地进度:{$vv.user_name}</a>
                        <div class="collapse-content">
                            <ul>
                                <li><span class="spanWidth">所属工地</span> {$vv.progress_building}</li> 
                                <li><span class="spanWidth">单位</span> {$vv.progress_unit}</li>
                                <li><span class="spanWidth">工程量</span> {$vv.progress_quantities}</li>
                                <li><span class="spanWidth">综合单价</span> {$vv.progress_unitprice}</li>
                                <li><span class="spanWidth">合计</span> {$vv.progress_amount}</li>
                                <li><span class="spanWidth">完工量</span> {$vv.progress_completions}</li>
                                <li><span class="spanWidth">小计</span> {$vv.progress_subtotal}</li>
                                <!-- <li><span class="spanWidth">签单人</span> {$vv.progress_building}</li> -->
                                <!-- <li><span class="spanWidth"></span> <img src="__CDN__/style/images/project.png" alt=""></li> -->
                            </ul>
                            <!-- <a class="schedule-msg-btn" href="javascript:void(0);">编辑</a> -->
                        </div>
                    </li>
                    <?php } ?>
                    {/volist} 
                </ul>
            </li>
            <li>
                <h2 id="scheduleEnd">提交结算书 <i class="dian"></i></h2>
                 {volist name="list" id="vv"} 
                    <?php if($vv['progress_type'] ==2 ) {?>
                <p><span class="spanWidth"><?php echo date("Y-m-d",$vv['progress_add_time'])?></span> 负责人 {$vv.user_name}</p>
                  <?php } ?>
                    {/volist} 
            </li>
        <!--     <li>
                <h2>工程完结 <i class="dian"></i></h2>
                <p><span class="spanWidth">2018-04-25</span> 负责人×××</p>
            </li> -->
        </ul>
    </div>
</div>
   <div class="mui-content-padded btn-bottom-fixed"><a href="/index/site/schedule_add.html">
    <button style="background: linear-gradient(-90deg, #3383FD, #78C2FF);border: none" type="button" class="mui-btn mui-btn-primary mui-btn-block">进度申报</button></a>
</div>
<script src="__CDN__/style/js/jquery-1.11.3.js"></script>
<script>
    // $('body').click(function () {
    //     var start=$('#scheduleStart').offset().top;
    //     var end=$('#scheduleEnd').offset().top;
    //     $(".zhe").css('top',(end-start+29)+"px")
    // });

    // $(window).on("touchstart", function(e) {
    //     e.preventDefault();
    //     var start=$('#scheduleStart').offset().top;
    //     var end=$('#scheduleEnd').offset().top;
    //     $(".zhe").css('top',(end-start+29)+"px")
    // });
    $("#schList").on("click",".collapse", function() {
        //console.dirxml(this);
        var _this=$(this);
        if(_this.children('.collapse-content').css("display") === "none") {
            _this.siblings().children(".collapse-content").hide();
            _this.children('.collapse-content').show();
        }else{
            _this.children('.collapse-content').css("display","none");
        }
        var start=$('#scheduleStart').offset().top;
        var end=$('#scheduleEnd').offset().top;
        $(".zhe").css('top',(end-start+29)+"px")
    });
    $(function () {
        var start=$('#scheduleStart').offset().top;
        var end=$('#scheduleEnd').offset().top;
           $(".zhe").css('top',(end-start+29)+"px")
    });


    $(function () {
        var startX=0,startY=0,moveEndX=0,moveEndY=0,X=0,Y=0,nowX=0;
        var a=$("#navBar");
        var navWidth=parseInt(a.css('width'));
        //var ulWidth=parseInt(a.children().css('width'));
        var ulWidth=parseInt(a.children().children().css('width'))*7+20;
        a.children().css('width',ulWidth);

        a.on("touchstart", function(e) {
            // e.preventDefault();
            startX = e.originalEvent.changedTouches[0].pageX;
            startY = e.originalEvent.changedTouches[0].pageY;
            nowX=parseInt(a.children().css('left'));
        });
        a.on("touchmove", function(e) {
            // e.preventDefault();
            moveEndX = e.originalEvent.changedTouches[0].pageX;
            moveEndY = e.originalEvent.changedTouches[0].pageY;
            X = moveEndX - startX;
            Y = moveEndY - startY;
            if ( Math.abs(X) > Math.abs(Y) && X > 0 ) {
                // alert("left 2 right");
                //console.log(X,Y);
                if((X+nowX)<0){
                    a.children().css('left',(X+nowX)+'px');
                }
            }
            else if ( Math.abs(X) > Math.abs(Y) && X < 0 ) {
                //alert("right 2 left");
                //console.log(navWidth,ulWidth,navWidth-ulWidth);
                //console.log(liWidth);
                if((X+nowX)>(navWidth-ulWidth)){
                    a.children().css('left',(X+nowX)+'px');
                }
            }
            else if ( Math.abs(Y) > Math.abs(X) && Y > 0) {
                //alert("top 2 bottom");
            }
            else if ( Math.abs(Y) > Math.abs(X) && Y < 0 ) {
                //alert("bottom 2 top");
            }
            else{
                //alert("just touch");
            }
        });
    });
</script>
 